package com.kai.mqtt.controller;

import com.kai.mqtt.data.PageResult;
import com.kai.mqtt.data.request.PageSubscribeMessageRequest;
import com.kai.mqtt.data.response.SubscribeMessageResponse;
import com.kai.mqtt.message.service.ISubscribeMessageService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author weijk
 * @since 2024/7/6
 */
@RestController
@RequestMapping("/subscribe")
public class SubscribeController {

    @Resource
    private ISubscribeMessageService subscribeMessageService;

    /**
     * 分页查询订阅消息列表
     *
     * @param request 参数
     * @return 订阅消息列表
     */
    @PostMapping("/page")
    public PageResult<SubscribeMessageResponse> pageSubscribe(@RequestBody PageSubscribeMessageRequest request) {
        return subscribeMessageService.pageSubscribe(request);
    }
}
